package com.ldc.commonlibs.uts

import com.ldc.commonlibs.common.RspModel

object ApiUtils {


    // 判断受否登录成功
    fun <T> isSuccess(model: RspModel<T>): Boolean = isSuccess(model.errorCode)
    fun isSuccess(errorCode: Int): Boolean = errorCode == 0
    fun <T> getErrorMsg(model: RspModel<T>): String = model.errorMsg
    fun <T> getData(model: RspModel<T>): T? = model.data
    fun <T> isLogin(model: RspModel<T>): Boolean = isLogin(model.errorCode)
    fun isLogin(errorCode: Int): Boolean = errorCode != -1001
}